<template>
  <router-link :to="`/product/${goods.id}`" class="goods-item">
    <img v-lazy="goods.picture" alt="">
    <p class="name ellipsis">{{ goods.name }}</p>
    <p class="desc ellipsis">{{ goods.desc }}</p>
    <p class="price">¥{{ goods.price }}</p>
  </router-link>
</template>

<script>
export default {
  name: 'GoodsItem',
  props: {
    goods: {
      type: Object,
      default: () => {
      }
    }
  }
}
</script>

<style lang="less" scoped>

.goods-item {
  display: block;
  height: 300px;
  width: 220px;
  padding: 20px 30px;
  text-align: center;
  .hoverShadow();

  img {
    height: 160px;
    width: 160px;
  }

  p {
    //margin-top: 10px;
    padding-top: 10px;

    &.name {
      font-size: 16px;
    }

    &.desc {
      font-size: 14px;
      color: #999;
    }

    &.price {
      font-size: 20px;
      color: @priceColor;
    }
  }
}
</style>
